<?php
class Controller_Weibo extends Controller{

	function before() {
		$login = Session::get('login');
		$open = array('Controller_Update');
		if (!$login AND !in_array($this->request->route->controller, $open)) {
			Response::redirect(Uri::base(false) . 'login');
		}
		Config::load('nav', true);
		$this->data['nav'] = Config::get('nav.top_nav', array());
		$this->data['username'] = Session::get('username', 'nobody');

		include_once( APPPATH . 'classes/controller/saetv2.ex.class.php' );
		Config::load('weibo', true);

		Config::load('pagination', true);
	}

	public static function msg($data, $format = 'json') {
		switch ($format) {
			case 'json':
			default:
				return json_encode($data);
				break;
		}
	}
}
